#pragma once
#include "SFC_Types.h"
/** \brief Added missing features.
 */

template<typename T> inline T Abs(const T &v) { return (v >= 0)? v : -v; }
template<typename T> inline void Swap(T &a1, T &a2) { if (a1 != a2) { a1 ^= a2; a2 ^= a1; a1 ^= a2; } }

/* Surface Method */
Surface CreateSurface(int w, int h);
void FreeSurface(Surface surface);
void BlitSurface(Surface src, SFC_Rect *srect, Surface dest, SFC_Rect *drect);

/* Draw Method */
void FillRect(Surface surface, const SFC_Rect *rect, Uint32 color);
void DrawLine(Surface surface, int x1, int y1, int x2, int y2, Uint32 color);
void DrawLines(Surface surface, SFC_Point *points, int num, Uint32 color);
void DrawRect(Surface surface, SFC_Rect *rect, Uint32 color);

/* Utils Tool */
void SaveRAWHex(const char *file, Surface surface);

/* Text Method */
int CreateFontHandle(const char *FontFile, int Size);
void FreeFontHandle(const int FontHandle);
Surface RenderText(const int FontHandle, const char *Text, Uint32 color);
void TestTextSize(const int FontHandle, const char *Text, int *Width, int *Height);